import React from 'react'
import ReactDOM from 'react-dom'

class Hello extends React.Component{
    
    handleClick(e) {
        // 阻止事件
        e.preventDefault()
        console.log('吱吱吱吱在')
    }

    render (){
        return (
            <div>
                <a href='https://www.baidu.com' onClick={this.handleClick} >点不会跳</a>
            </div>
        )
    }
}

ReactDOM.render(<Hello/>, document.getElementById('root'))